import pymysql
db = pymysql.connect(host='localhost', user='root',
                     password='Kpds@512', port=3306, db='spiders')
cursor = db.cursor()

#sql = "CREATE TABLE IF NOT EXISTS  wee (name varchar(10), age int(2));"

#sql = "CREATE TABLE IF NOT EXISTS xizhongwang (title VARCHAR(255) NOT NULL, laiyuan VARCHAR(255) NOT NULL, zuozhe VARCHAR(255) NOT NULL,fabu VARCHAR(255) NOT NULL,liulan VARCHAR(255) NOT NULL,neirongmedium text NOT NULL,tupianmedium text NOT NULL,PRIMARY KEY (title));"

# sql = 'CREATE TABLE IF NOT EXISTS xizhongwang (title VARCHAR(255) NOT NULL, ' \
#       'laiyuan VARCHAR(255) NOT NULL, zuozhe VARCHAR(255) NOT NULL,' \
#       'fabu VARCHAR(255) NOT NULL,liulan VARCHAR(255) NOT NULL,' \
#       'neirongmedium text NOT NULL,tupianmedium text NOT NULL,PRIMARY KEY (title))'


sql = "CREATE TABLE IF NOT EXISTS spider_ts(Id Int Unsigned Auto_Increment,main_title text,key_world text,sub_title text,from_url Varchar(255),fbrq Varchar(20),Primary Key(`Id`));"




cursor.execute(sql)
db.close()